package com.ruoyi.common.utils.kiam;

import org.bouncycastle.crypto.digests.SM3Digest;
import org.bouncycastle.util.encoders.Hex;

public class SM3Util {

    public static String hash(byte[] srcData) {
        String hashStr= null;
        SM3Digest digest = new SM3Digest();
        digest.update(srcData, 0, srcData.length);
        byte[] hash = new byte[digest.getDigestSize()];
        digest.doFinal(hash, 0);
        hashStr = Hex.toHexString(hash);
        return hashStr;
    }
}